Repository navigation
apply dark theme throughout the app - #13874
Conversation
|
@grgia @aimane-chnaif One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Safarimsafari.mp4Desktopdesktop.moviOSios.mp4 |
aimane-chnaif
left a comment
There was a problem hiding this comment.
LGTM and tests well
cc: @grgia
grgia
left a comment
There was a problem hiding this comment.
Code looks good! I think we should add a comment for clarification and then we should be good to go
| @Override | ||
| public void onCreate() { | ||
| super.onCreate(); | ||
| AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); |
There was a problem hiding this comment.
Let's add a comment here about why we need to set android to night mode in addition to setting the BaseAppTheme.
There was a problem hiding this comment.
Theme.AppCompat.Light.NoActionBar -> Theme.AppCompat.NoActionBar is enough to change app theme to dark which applied to splash screen, keyboard empty space and scroll indicator color, etc. But this doesn't involve navigation bar (I tested and confirmed).
That's why I did below change as well to make navigation bar color dark even though device theme is light, which fixes #13087.
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);What will be a good comment here do you suggest?
There was a problem hiding this comment.
Always use dark (night) theme so it doesn't depend on system theme.
Something like this?
There was a problem hiding this comment.
How about Use night (dark) mode so native UI defaults to dark theme. ?
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
This PR is causing a To fix it we need to set color to colorBackgroundFloating to fix the issue in styles.xml because applying background color dark to android app also causes Modals to be Dark. As it is a After Fix :- WhatsApp.Video.2023-01-03.at.11.13.45.AM.1.mp4 |
|
@grgia @aimane-chnaif This PR caused #13951 but this came from lack of dark mode support in react-native-picker-select package (last publish was 2 years ago and not maintained). So in our app, we're still using light theme for picker even though entire app is dark theme. cc: @shawnborton This should be exact looking in dark mode for android: dark.theme.mp4For iOS, this package doesn't support dark mode yet. There's a PR for this but it seems no one cares about it. For web, dark mode is still not supported in react-native-web Picker. That's why @luacmartins added code here: App/src/components/Picker/index.js Lines 171 to 172 in 466b027 So the solution is to set picker text color to white in android (like video above), and still keep light mode (white background, dark text) in all other platforms. But eventually, we need to fix iOS and web too to apply dark theme to picker, either customizing this package or replace with other good package. |
|
That makes sense to me, but curious what our engineers think as well. |
|
While I agree that @0xmiroslav's proposal appears to make the picker look correct in dark mode, if we're using a light mode picker in every other version of the app, then I think we should do the same for Android till we can update it everywhere, which would make @syedsaroshfarrukhdot proposal the appropriate solution. And as @jasperhuangg pointed out in blocker issue, this is a visual quirk, not a functional break, so it's not a blocker, which gives us a bit of breathing room to discuss it. |
|
🚀 Deployed to production by @roryabraham in version: 1.2.47-0 🚀
|
|
🚧 @JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |




Details
force dark theme on all platforms
Fixed Issues
$ #12914
PROPOSAL: #12914 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Chrome (Mac):

Chrome (Windows) (thumb active):

Chrome (Windows) (thumb inactive):

Firefox (Windows):

Safari (Mac):

Mobile Web - Chrome
Mobile Web - Safari
Desktop
desktop.mov
iOS
Android